<?php

use Illuminate\Support\Facades\Route;
use Illuminate\Routing\Router;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/


Route::group([
    'prefix' => 'book',
    'namespace'  => 'App\\Http\\Controllers\\Book',
    //'middleware' => 'token.refresh'
],function (Router $router){

    $router->get('/','BookController@index');
    $router->get('show','BookController@show');
    $router->post('comment/store','CommentController@store');

});



Route::group([
    'namespace'  => 'App\\Http\\Controllers',
    //'middleware' => 'token.refresh'
],function (Router $router){
    $router->post('upload','UploadController@index');
    $router->get('banner','BannerController@index');
    $router->get('setting','SettingController@index');
    $router->get('agreement','AgreementController@index');
    $router->get('agreement/show','AgreementController@show');
    $router->get('wx/order','WxOrderController@index');
    $router->post('sms','SmsController@index');
    $router->get('message','MessageController@index');
    $router->get('message/show','MessageController@show');
    $router->get('sse','IndexController@sse');
    $router->get('send','IndexController@send');
    $router->get('comment/statement','CommentStatementController@index');
    $router->post('feedback/comment','FeedbackCommentController@store');

});

Route::group([
    'prefix' => 'user',
    'namespace'  => 'App\\Http\\Controllers\\User\\',
    'middleware' => 'token.refresh'
],function (Router $router){
    $router->post('login','LoginController@index')->withoutMiddleware('token.refresh');
    $router->post('logout','LoginController@logout');
    $router->post('min/phone','LoginController@minPhone')->withoutMiddleware('token.refresh');
    $router->post('min/openid','LoginController@minOpenid')->withoutMiddleware('token.refresh');
    $router->post('app/user','LoginController@appUser')->withoutMiddleware('token.refresh');

    $router->get('auth/show','AuthController@show');
    $router->post('auth/store','AuthController@store');
    $router->get('show','UserController@show');
    $router->get('points','PointsController@index');

    $router->get('operate','UserController@operate');
    $router->get('download','UserController@download');
    $router->get('consult','UserController@consult');


    $router->get('center','UserController@center');
    $router->get('publish','UserController@publish');
    $router->post('update','UserController@update');
    $router->get('sig','UserController@sig');

    $router->get('identity','IdentityController@index');
    $router->get('identity/show','IdentityController@show');
    $router->post('identity/store','IdentityController@store');
    $router->post('identity/consultation','IdentityController@consultation');

    $router->get('store/plan/total','StorePlanController@index');
    $router->post('store/plan','StorePlanController@store');

    $router->get('sign','SignController@index');
    $router->get('sign/view','SignController@view');
    $router->get('sign/show','SignController@show');
    $router->get('sign/config','SignController@config');
    $router->post('sign/store','SignController@store');


    $router->get('group','GroupController@index');
    $router->get('group/qrcode','GroupController@qrcode');


    //关注
    $router->post('follow/store','FollowController@store');
    $router->get('follow','FollowController@index');
    $router->get('follow/not','FollowController@not');
    $router->get('follow/article','FollowController@article');


    $router->get('member','MemberController@index');
    $router->get('member/show','MemberController@show');
    $router->get('article','ArticleController@index');
    $router->get('member/list','MemberController@list');
    $router->post('member/store','MemberController@store');
    $router->post('member/notify','MemberController@notify')->withoutMiddleware('token.refresh');
    $router->post('member/ali/notify','MemberController@aliNotify')->withoutMiddleware('token.refresh');


    $router->get('user/course','CourseController@index');


    $router->get('collect/article','CollectController@article');
    $router->get('collect/brand','CollectController@brand');
    $router->get('collect/course','CollectController@course');



    $router->get('withdraw','WithdrawController@index');
    $router->post('withdraw/store','WithdrawController@store');

    $router->get('task','TaskController@index')->withoutMiddleware('token.refresh');

    // 打赏

    $router->post('gift/store','GiftController@store')->withoutMiddleware('token.refresh');
    $router->post('gift/notify','GiftController@notify')->withoutMiddleware('token.refresh');
    $router->post('gift/ali/notify','GiftController@aliNotify')->withoutMiddleware('token.refresh');

    // 用户收益
    $router->get('income/total','IncomeController@total');
    $router->get('income','IncomeController@index');

    // 团队统计

    $router->get('promotion','PromotionController@index')->withoutMiddleware('token.refresh');
    $router->get('promotion/group','PromotionController@group')->withoutMiddleware('token.refresh');


    $router->get('message','MessageController@index');
    $router->get('message/list','MessageController@list');
    $router->get('message/show','MessageController@show');
    $router->get('message/read','MessageController@read');

    $router->get('title','TitleController@index');
});

Route::group([
    'prefix' => 'article',
    'namespace'  => 'App\\Http\\Controllers\\Article\\',
    //'middleware' => 'token.refresh'
],function (Router $router){
    $router->get('topic/category','TopicCategoryController@index');
    $router->get('topic/category/show','TopicCategoryController@show');
    $router->post('topic/category/store','TopicCategoryController@store');
    $router->get('category','CategoryController@index');
    $router->get('/','IndexController@index');
    $router->get('unlock/check','UnlockController@check');
    $router->get('unlock/points','UnlockController@points');
    $router->post('unlock','UnlockController@index');
    $router->post('score/store','ScoreController@store');
    $router->get('share','IndexController@share');
    $router->get('show','IndexController@show');
    $router->middleware('token.refresh')->post('store','IndexController@store');


    $router->get('comment','CommentController@index');
    $router->post('comment/store','CommentController@store');
    $router->get('comment/delete','CommentController@delete');
    $router->post('comment/like','CommentLikeController@store');


    $router->post('like/store','LikeController@store');
    $router->get('collect','CollectController@index');
    $router->post('collect/store','CollectController@store');


});

Route::group([
    'prefix' => 'course',
    'namespace'  => 'App\\Http\\Controllers\\Course\\',
    //'middleware' => 'token.refresh'
],function (Router $router){
    $router->get('category','CategoryController@index');
    $router->get('/','CourseController@index');
    $router->get('share','CourseController@share');
    $router->get('list','CourseController@list');
    $router->get('delete','CourseController@delete');
    $router->get('show','CourseController@show');
    $router->get('status','CourseController@status');
    $router->get('chapter','ChapterController@index');
    $router->post('store','CourseController@store');
    $router->post('update','CourseController@update');

    $router->get('chapter/number','ChapterNumberController@index');

    $router->post('chapter/store','ChapterController@store');
    $router->post('chapter/study','ChapterController@study');
    $router->post('chapter/update','ChapterController@update');
    $router->get('comment','CommentController@index');

    $router->post('comment/store','CommentController@store');
    $router->get('comment/delete','CommentController@delete');


    $router->post('like/store','LikeController@store');
    $router->get('collect','CollectController@index');
    $router->post('collect/store','CollectController@store');


    $router->get('order','OrderController@index');
    $router->get('order/show','OrderController@show');
    $router->post('order/store','OrderController@store');

    $router->post('order/notify','OrderController@notify')->withoutMiddleware('token.refresh');
    $router->post('order/ali/notify','OrderController@aliNotify')->withoutMiddleware('token.refresh');
    $router->post('after/sale/message','AfterSaleMessage@store');


});


Route::group([
    'prefix' => 'rank',
    'namespace'  => 'App\\Http\\Controllers\\Rank\\',
    //'middleware' => 'token.refresh'
],function (Router $router){
    $router->get('brand','IndexController@brand');
    $router->get('form','IndexController@form');
    $router->get('comment','IndexController@comment');
    $router->get('view','IndexController@view');
    $router->get('course','IndexController@course');
    $router->get('collect','IndexController@collect');
    $router->get('comments','IndexController@comments');
    $router->get('post','IndexController@post');
    $router->get('join','IndexController@join');
    $router->get('preview','IndexController@preview');

});


Route::group([
    'prefix' => 'firm',
    'namespace'  => 'App\\Http\\Controllers\\Firm\\',
    //'middleware' => 'token.refresh'
],function (Router $router){
    $router->get('category','CategoryController@index');
    $router->get('/','FirmController@index');
    $router->get('show','FirmController@show');
    $router->get('profession','ProfessionController@index');
    $router->post('store','FirmController@store');
    $router->post('consultation','FirmController@consultation');
    $router->post('interested','FirmController@interested');
    $router->post('profile/store','ProfileController@store');
    $router->post('message/store','MessageController@store');
    $router->post('level/message/store','LeaveMessageController@store');


    $router->post('like/store','LikeController@store');
    $router->get('collect','CollectController@index');
    $router->post('collect/store','CollectController@store');


    $router->get('comment','CommentController@index');
    $router->post('comment/store','CommentController@store');

    $router->get('comment/delete','CommentController@delete');

});


Route::group([
    'prefix' => 'brand',
    'namespace'  => 'App\\Http\\Controllers\\Brand\\',
    'middleware' => 'token.refresh'
],function (Router $router){
    $router->get('cradle','CradleController@index');
    $router->get('location','LocationController@index');
    $router->post('join/plan','JoinPlanController@store');
    $router->get('join/plan/show','JoinPlanController@show');
    $router->get('/','BrandController@index');
    $router->get('firm','BrandController@firm');
    $router->get('show/{id}','BrandController@show');
    $router->post('profile/store','ProfileController@store');
    $router->post('store','BrandController@store');
    $router->post('interested','BrandController@interested');
    $router->post('profile/update','ProfileController@update');
    $router->post('message/store','MessageController@store');


    $router->post('like/store','LikeController@store');
    $router->get('collect','CollectController@index');
    $router->post('collect/store','CollectController@store');

});

Route::group([
    'prefix' => 'circle',
    'namespace'  => 'App\\Http\\Controllers\\Circle\\',
],function (Router $router){


    $router->get('category','CircleController@category');
    $router->get('/','CircleController@index');
    $router->get('show','CircleController@show');
    $router->middleware('token.refresh')->post('store','CircleController@store');
    $router->middleware('token.refresh')->post('join','CircleController@join');

});

Route::group([
    'prefix' => 'ad',
    'namespace'  => 'App\\Http\\Controllers\\Ad\\',
],function (Router $router){
    $router->get('category','CategoryController@index');
    $router->get('total','TotalController@index');
    $router->get('hierarchy','HierarchyController@index');
    $router->get('price','PriceController@index');
    $router->get('/','AdController@index');
    $router->get('list','AdController@list');
    $router->get('put','AdController@put');
    $router->post('order','AdController@order');
    $router->get('show','AdController@show');
    $router->middleware('token.refresh')->post('store','AdController@store');
    $router->post('notify','AdController@notify')->withoutMiddleware('token.refresh');
    $router->post('ali/notify','AdController@aliNotify')->withoutMiddleware('token.refresh');
});


Route::group([
    'prefix' => 'talent',
    'namespace'  => 'App\\Http\\Controllers\\Talent\\',
],function (Router $router){
    $router->post('job/store','JobController@store');
    $router->get('job','JobController@index');
    $router->get('job/show','JobController@show');
    $router->middleware('token.refresh')->post('store','TalentController@store');
    $router->get('position','PositionController@index');
    $router->middleware('token.refresh')->post('position/apply','PositionController@apply');
    $router->get('position/show','PositionController@show');
    $router->get('post','PostController@index');
});
